WIP: Patches to let libopenshot compile with ffmpeg version after 4.4#670
WIP: Patches to let libopenshot compile with ffmpeg version after 4.4#670eisneinechse wants to merge 5 commits intoOpenShot:developfrom
Conversation
This is a work in progress. The export of the audio is still broken which started on June 18 with the removal of deprecated call in ffmpeg.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #670 +/- ##
========================================
Coverage 50.41% 50.41%
========================================
Files 155 155
Lines 13315 13315
========================================
Hits 6713 6713
Misses 6602 6602 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Merge conflicts have been detected on this PR, please resolve. |
|
Merge conflicts have been detected on this PR, please resolve. |
|
Merge conflicts have been detected on this PR, please resolve. |
src/FFmpegWriter.cpp
Outdated
| #if IS_FFMPEG_4_4 | ||
| pkt.size = sizeof(AVFrame); | ||
| #else | ||
| pkt.size = sizeof(AVPicture); | ||
| #endif |
There was a problem hiding this comment.
Hah! Well, crap. I only just noticed that this 4-month-old comment was still "Pending", and only visible to me! Whoops. Sorry about that.
Instead of directly setting packet.size, should this be using av_packet_from_data(&pkt, buffer, size)?
Or, in the cases where the data isn't in an av_malloc()'d buffer like _from_data() requires (i.e. audio), at the very least an av_new_packet(&pkt, size) followed by a memcpy()?
av_init_packet() has now been deprecated, a change that was formally made only recently... but in part, it's been deprecated because there have been better replacements for a very long time. Both av_new_packet() and av_packet_from_data() were available as far back as FFmpeg 2.4. So, we could switch our existing code away from it for all FFmpeg versions, not just 4.4+.
...Ultimately that's what I ended up doing in #784, since av_packet_from_data has "always" (as far as we're concerned) been available. So now we just leave it to avcodec (or is it avformat? avutil?) to figure out how to size things. I figure it should know best!
|
Was already resolved by another patch |
1 similar comment
|
Was already resolved by another patch |
This is a work in progress. The export of the audio is still broken
which started on June 18 with the removal of deprecated call in
ffmpeg.